package com.net.oil.coupon.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.coupon.bean.CouponDetailBean;
import com.net.oil.coupon.bean.CouponRecordVO;
import com.net.oil.coupon.contract.CouponDetailContract;
import com.net.oil.coupon.model.CouponDetailModel;

/**
 * 作者：lch
 * 时间：2018/5/26 0026:上午 10:06
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class CouponDetailPresenter extends BasePresenter<CouponDetailContract.View> implements CouponDetailContract.Presenter {

    private CouponDetailContract.View view;
    private CouponDetailContract.Model model;

    public CouponDetailPresenter(CouponDetailContract.View view) {
        this.view = view;
        model = new CouponDetailModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getCouponDetail(int id) {
        model.getCouponDetail(id);
    }

    @Override
    public void getCouponDetailSuccess(CouponRecordVO couponDetailBean) {
        view.getCouponDetailSuccess(couponDetailBean);
    }

    @Override
    public void getCouponDetailFailed() {
        view.getCouponDetailFailed();
    }
}
